﻿package
{
	import org.flixel.FlxSprite;
	import org.flixel.FlxG;
	
	public class ASPlayerShot extends FlxSprite
	{
		[Embed(source = 'data/playershot.png')] private var imgPlayerShot:Class;
		[Embed(source = 'data/playershot.mp3')] private var sndPlayerShot:Class;
		
		public function ASPlayerShot()
		{
			//super(imgPlayerShot);
			super(0, 0, imgPlayerShot);
			exists = false;
			visible = false;
		}

		public function spawn(X:int, Y:int):void
		{
			x = X; y = Y;
			velocity.y = -500;
			exists = true;
			visible = true;
			FlxG.play(sndPlayerShot,2);
		}
		
		override public function update():void
		{
			if (y < 0) {
				exists = false;
				visible = false;
			}
			super.update();
		}
	}
}